<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../../">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>pyokx.ws_data_structures &mdash; AntBot 0.0.1 documentation</title>
      <link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=80d5e7a1" />
      <link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />
      <link rel="stylesheet" type="text/css" href="../../_static/graphviz.css?v=eafc0fe6" />

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script src="../../_static/jquery.js?v=5d32c60e"></script>
        <script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
        <script src="../../_static/documentation_options.js?v=d45e8c67"></script>
        <script src="../../_static/doctools.js?v=888ff710"></script>
        <script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
    <script src="../../_static/js/theme.js"></script>
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >

          
          
          <a href="../../index.html" class="icon icon-home">
            AntBot
          </a>
              <div class="version">
                0.0.1
              </div>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../autodocumentation_python.html">autodocumentation_python</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../firebase_tools.BaseClasses.html">firebase_tools.BaseClasses</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../firebase_tools.FirestoreClient.html">firebase_tools.FirestoreClient</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../firebase_tools.authenticate.html">firebase_tools.authenticate</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../h2o_dashboard.dashboard.html">h2o_dashboard.dashboard</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../h2o_dashboard.pages.documentation_page.html">h2o_dashboard.pages.documentation_page</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../h2o_dashboard.pages.okx_dashbaord_page.okx_antbot_okx_premium_indicator_handler.html">h2o_dashboard.pages.okx_dashbaord_page.okx_antbot_okx_premium_indicator_handler</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../h2o_dashboard.pages.okx_dashbaord_page.okx_dashboard_page.html">h2o_dashboard.pages.okx_dashbaord_page.okx_dashboard_page</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../h2o_dashboard.pages.okx_streams.html">h2o_dashboard.pages.okx_streams</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../h2o_dashboard.pages.overview_page.html">h2o_dashboard.pages.overview_page</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../h2o_dashboard.util.html">h2o_dashboard.util</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../h2o_dashboard.wave_auth.html">h2o_dashboard.wave_auth</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.Futures_Exchange_Client.html">pyokx.Futures_Exchange_Client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.InstrumentSearcher.html">pyokx.InstrumentSearcher</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.data_structures.html">pyokx.data_structures</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.low_rest_api.Account.html">pyokx.low_rest_api.Account</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.low_rest_api.BlockTrading.html">pyokx.low_rest_api.BlockTrading</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.low_rest_api.Convert.html">pyokx.low_rest_api.Convert</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.low_rest_api.CopyTrading.html">pyokx.low_rest_api.CopyTrading</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.low_rest_api.Earning.html">pyokx.low_rest_api.Earning</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.low_rest_api.FDBroker.html">pyokx.low_rest_api.FDBroker</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.low_rest_api.Funding.html">pyokx.low_rest_api.Funding</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.low_rest_api.Grid.html">pyokx.low_rest_api.Grid</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.low_rest_api.MarketData.html">pyokx.low_rest_api.MarketData</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.low_rest_api.NDBroker.html">pyokx.low_rest_api.NDBroker</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.low_rest_api.PublicData.html">pyokx.low_rest_api.PublicData</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.low_rest_api.SpreadTrading.html">pyokx.low_rest_api.SpreadTrading</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.low_rest_api.Status.html">pyokx.low_rest_api.Status</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.low_rest_api.SubAccount.html">pyokx.low_rest_api.SubAccount</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.low_rest_api.Trade.html">pyokx.low_rest_api.Trade</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.low_rest_api.TradingData.html">pyokx.low_rest_api.TradingData</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.low_rest_api.client.html">pyokx.low_rest_api.client</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.low_rest_api.consts.html">pyokx.low_rest_api.consts</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.low_rest_api.exceptions.html">pyokx.low_rest_api.exceptions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.low_rest_api.utils.html">pyokx.low_rest_api.utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.market_data_service.WssMarketDataService.html">pyokx.okx_market_maker.market_data_service.WssMarketDataService</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.market_data_service.model.Instrument.html">pyokx.okx_market_maker.market_data_service.model.Instrument</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.market_data_service.model.MarkPx.html">pyokx.okx_market_maker.market_data_service.model.MarkPx</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.market_data_service.model.OrderBook.html">pyokx.okx_market_maker.market_data_service.model.OrderBook</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.market_data_service.model.Tickers.html">pyokx.okx_market_maker.market_data_service.model.Tickers</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.order_management_service.WssOrderManagementService.html">pyokx.okx_market_maker.order_management_service.WssOrderManagementService</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.order_management_service.model.Order.html">pyokx.okx_market_maker.order_management_service.model.Order</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.order_management_service.model.OrderRequest.html">pyokx.okx_market_maker.order_management_service.model.OrderRequest</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.position_management_service.WssPositionManagementService.html">pyokx.okx_market_maker.position_management_service.WssPositionManagementService</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.position_management_service.model.Account.html">pyokx.okx_market_maker.position_management_service.model.Account</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.position_management_service.model.BalanceAndPosition.html">pyokx.okx_market_maker.position_management_service.model.BalanceAndPosition</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.position_management_service.model.Positions.html">pyokx.okx_market_maker.position_management_service.model.Positions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.run_sample_market_maker.html">pyokx.okx_market_maker.run_sample_market_maker</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.settings.html">pyokx.okx_market_maker.settings</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.strategy.BaseStrategy.html">pyokx.okx_market_maker.strategy.BaseStrategy</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.strategy.SampleMM.html">pyokx.okx_market_maker.strategy.SampleMM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.strategy.model.StrategyMeasurement.html">pyokx.okx_market_maker.strategy.model.StrategyMeasurement</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.strategy.model.StrategyOrder.html">pyokx.okx_market_maker.strategy.model.StrategyOrder</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.strategy.params.ParamsLoader.html">pyokx.okx_market_maker.strategy.params.ParamsLoader</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.strategy.risk.RiskCalculator.html">pyokx.okx_market_maker.strategy.risk.RiskCalculator</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.strategy.risk.RiskSnapshot.html">pyokx.okx_market_maker.strategy.risk.RiskSnapshot</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.tests.test_strategy.html">pyokx.okx_market_maker.tests.test_strategy</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.utils.InstrumentUtil.html">pyokx.okx_market_maker.utils.InstrumentUtil</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.utils.OkxEnum.html">pyokx.okx_market_maker.utils.OkxEnum</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.utils.TdModeUtil.html">pyokx.okx_market_maker.utils.TdModeUtil</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.okx_market_maker.utils.WsOrderUtil.html">pyokx.okx_market_maker.utils.WsOrderUtil</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.redis_structured_reports.html">pyokx.redis_structured_reports</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.redis_structured_streams.html">pyokx.redis_structured_streams</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.rest_handling.html">pyokx.rest_handling</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.rest_messages_service.html">pyokx.rest_messages_service</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.strategy_handling.html">pyokx.strategy_handling</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.test.AccountTest.html">pyokx.test.AccountTest</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.test.BlockTradingTest.html">pyokx.test.BlockTradingTest</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.test.BrokerTest.html">pyokx.test.BrokerTest</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.test.ConvertTest.html">pyokx.test.ConvertTest</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.test.CopyTradingTest.html">pyokx.test.CopyTradingTest</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.test.EarningTest.html">pyokx.test.EarningTest</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.test.FundingTest.html">pyokx.test.FundingTest</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.test.GridTest.html">pyokx.test.GridTest</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.test.MarketTest.html">pyokx.test.MarketTest</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.test.PublicDataTest.html">pyokx.test.PublicDataTest</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.test.SpreadTest.html">pyokx.test.SpreadTest</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.test.StackingTest.html">pyokx.test.StackingTest</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.test.SubAccountTest.html">pyokx.test.SubAccountTest</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.test.TradeTest.html">pyokx.test.TradeTest</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.test.TradingDataTest.html">pyokx.test.TradingDataTest</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.test.WsPrivateAsyncTest.html">pyokx.test.WsPrivateAsyncTest</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.test.WsPublicAsyncTest.html">pyokx.test.WsPublicAsyncTest</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.websocket_handling.html">pyokx.websocket_handling</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.ws_clients.WebSocketFactory.html">pyokx.ws_clients.WebSocketFactory</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.ws_clients.WsPprivateAsync.html">pyokx.ws_clients.WsPprivateAsync</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.ws_clients.WsPublicAsync.html">pyokx.ws_clients.WsPublicAsync</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.ws_clients.WsUtils.html">pyokx.ws_clients.WsUtils</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../pyokx.ws_data_structures.html">pyokx.ws_data_structures</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../redis_tools.config.html">redis_tools.config</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../redis_tools.consumers.html">redis_tools.consumers</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../redis_tools.utils.html">redis_tools.utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rest_app.html">rest_app</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../routers.api_keys.html">routers.api_keys</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../routers.login.html">routers.login</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../routers.okx.html">routers.okx</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../routers.okx_authentication.html">routers.okx_authentication</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../routers.signup.html">routers.signup</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../shared.command_execution.html">shared.command_execution</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../shared.config.html">shared.config</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../shared.configuration_parser.html">shared.configuration_parser</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../shared.data_processing_utils.html">shared.data_processing_utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../shared.file_directory_ops.html">shared.file_directory_ops</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../shared.logging.html">shared.logging</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../shared.string_dict_utils.html">shared.string_dict_utils</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../shared.tmp_shared.html">shared.tmp_shared</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../tradingview_tools.tradingview_widgets.html">tradingview_tools.tradingview_widgets</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../websocket_app.html">websocket_app</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../index.html">AntBot</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../index.html" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../index.html">Module code</a></li>
      <li class="breadcrumb-item active">pyokx.ws_data_structures</li>
      <li class="wy-breadcrumbs-aside">
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <h1>Source code for pyokx.ws_data_structures</h1><div class="highlight"><pre>
<span></span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">List</span><span class="p">,</span> <span class="n">Optional</span>

<span class="kn">from</span> <span class="nn">pyokx.data_structures</span> <span class="kn">import</span> <span class="n">OKXBaseModel</span><span class="p">,</span> <span class="n">Instrument</span><span class="p">,</span> <span class="n">AccountBalanceData</span><span class="p">,</span> <span class="n">Ask</span><span class="p">,</span> <span class="n">Bid</span><span class="p">,</span> <span class="n">Ticker</span>

<span class="sd">&quot;&quot;&quot;The data structures used to represent the data received from the OKX Websocket API.&quot;&quot;</span>
<span class="sd">The channels are split into three categories: public, business, and private. The public channels are available to all</span>
<span class="sd">users, the business channels are typically for market makers, and the private channels are for the user&#39;s account data.</span>
<span class="sd">The websocket paths are</span>
<span class="sd">- wss://ws.okx.com:8443/ws/v5/public</span>
<span class="sd">- wss://ws.okx.com:8443/ws/v5/business</span>
<span class="sd">- wss://ws.okx.com:8443/ws/v5/private</span>
<span class="sd">- wss://wsaws.okx.com:8443/ws/v5/public</span>
<span class="sd">- wss://wsaws.okx.com:8443/ws/v5/business</span>
<span class="sd">- wss://wsaws.okx.com:8443/ws/v5/private</span>
<span class="sd">- wss://wspap.okx.com:8443/ws/v5/public?brokerId=9999</span>
<span class="sd">- wss://wspap.okx.com:8443/ws/v5/private?brokerId=9999</span>
<span class="sd">- wss://wspap.okx.com:8443/ws/v5/business?brokerId=9999</span>
<span class="sd">&quot;&quot;&quot;</span>


<div class="viewcode-block" id="TickersChannelInputArgs">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.TickersChannelInputArgs">[docs]</a>
<span class="k">class</span> <span class="nc">TickersChannelInputArgs</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">channel</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instId</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="TickersChannelReturnArgs">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.TickersChannelReturnArgs">[docs]</a>
<span class="k">class</span> <span class="nc">TickersChannelReturnArgs</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">channel</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instId</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="TickersChannel">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.TickersChannel">[docs]</a>
<span class="k">class</span> <span class="nc">TickersChannel</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">arg</span><span class="p">:</span> <span class="n">TickersChannelReturnArgs</span>
    <span class="n">data</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">Ticker</span><span class="p">]</span></div>



<div class="viewcode-block" id="CandleStick">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.CandleStick">[docs]</a>
<span class="k">class</span> <span class="nc">CandleStick</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">_primary_key_field</span> <span class="o">=</span> <span class="s1">&#39;timestamp&#39;</span>
    <span class="n">timestamp</span><span class="p">:</span> <span class="nb">str</span>
    <span class="nb">open</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">high</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">low</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">close</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">is_closed</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="PriceLimit">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.PriceLimit">[docs]</a>
<span class="k">class</span> <span class="nc">PriceLimit</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">_primary_key_field</span> <span class="o">=</span> <span class="s1">&#39;instId&#39;</span>
    <span class="n">instId</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">buyLmt</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">sellLmt</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">ts</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">enabled</span><span class="p">:</span> <span class="nb">bool</span></div>



<div class="viewcode-block" id="InstrumentsChannelInputArgs">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.InstrumentsChannelInputArgs">[docs]</a>
<span class="k">class</span> <span class="nc">InstrumentsChannelInputArgs</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">_primary_key_field</span> <span class="o">=</span> <span class="s1">&#39;instType&#39;</span>
    <span class="n">channel</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instType</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="InstrumentsChannel">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.InstrumentsChannel">[docs]</a>
<span class="k">class</span> <span class="nc">InstrumentsChannel</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">arg</span><span class="p">:</span> <span class="n">InstrumentsChannelInputArgs</span>
    <span class="n">data</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">Instrument</span><span class="p">]</span></div>



<div class="viewcode-block" id="PriceLimitChannelInputArgs">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.PriceLimitChannelInputArgs">[docs]</a>
<span class="k">class</span> <span class="nc">PriceLimitChannelInputArgs</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">_primary_key_field</span> <span class="o">=</span> <span class="s1">&#39;instId&#39;</span>
    <span class="n">channel</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instId</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="PriceLimitChannel">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.PriceLimitChannel">[docs]</a>
<span class="k">class</span> <span class="nc">PriceLimitChannel</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">arg</span><span class="p">:</span> <span class="n">PriceLimitChannelInputArgs</span>
    <span class="n">data</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">PriceLimit</span><span class="p">]</span></div>



<div class="viewcode-block" id="MarkPriceChannelInputArgs">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.MarkPriceChannelInputArgs">[docs]</a>
<span class="k">class</span> <span class="nc">MarkPriceChannelInputArgs</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">_primary_key_field</span> <span class="o">=</span> <span class="s1">&#39;instId&#39;</span>
    <span class="n">channel</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instId</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="MarkPrice">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.MarkPrice">[docs]</a>
<span class="k">class</span> <span class="nc">MarkPrice</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">_primary_key_field</span> <span class="o">=</span> <span class="s1">&#39;instId&#39;</span>
    <span class="n">instType</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instId</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">markPx</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">ts</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="MarkPriceChannel">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.MarkPriceChannel">[docs]</a>
<span class="k">class</span> <span class="nc">MarkPriceChannel</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">arg</span><span class="p">:</span> <span class="n">MarkPriceChannelInputArgs</span>
    <span class="n">data</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">MarkPrice</span><span class="p">]</span></div>



<div class="viewcode-block" id="MarkPriceCandleSticksChannelInputArgs">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.MarkPriceCandleSticksChannelInputArgs">[docs]</a>
<span class="k">class</span> <span class="nc">MarkPriceCandleSticksChannelInputArgs</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">_primary_key_field</span> <span class="o">=</span> <span class="s1">&#39;instId&#39;</span>
    <span class="n">channel</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instId</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="MarkPriceCandleSticksChannel">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.MarkPriceCandleSticksChannel">[docs]</a>
<span class="k">class</span> <span class="nc">MarkPriceCandleSticksChannel</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">arg</span><span class="p">:</span> <span class="n">MarkPriceChannelInputArgs</span>
    <span class="n">data</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">CandleStick</span><span class="p">]</span>

<div class="viewcode-block" id="MarkPriceCandleSticksChannel.from_array">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.MarkPriceCandleSticksChannel.from_array">[docs]</a>
    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">from_array</span><span class="p">(</span><span class="n">arg</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannelInputArgs</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
        <span class="n">data</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">CandleStick</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span>
            <span class="n">CandleStick</span><span class="p">(</span>
                <span class="n">timestamp</span><span class="o">=</span><span class="n">item</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span>
                <span class="nb">open</span><span class="o">=</span><span class="n">item</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span>
                <span class="n">high</span><span class="o">=</span><span class="n">item</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span>
                <span class="n">low</span><span class="o">=</span><span class="n">item</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span>
                <span class="n">close</span><span class="o">=</span><span class="n">item</span><span class="p">[</span><span class="mi">4</span><span class="p">],</span>
                <span class="n">is_closed</span><span class="o">=</span><span class="n">item</span><span class="p">[</span><span class="mi">5</span><span class="p">]</span>
            <span class="p">)</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">data</span>
        <span class="p">]</span>
        <span class="k">return</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">(</span><span class="n">args</span><span class="o">=</span><span class="n">arg</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="n">data</span><span class="p">)</span></div>
</div>


    <span class="c1"># B</span>


<div class="viewcode-block" id="IndexTickersChannelInputArgs">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.IndexTickersChannelInputArgs">[docs]</a>
<span class="k">class</span> <span class="nc">IndexTickersChannelInputArgs</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">_primary_key_field</span> <span class="o">=</span> <span class="s1">&#39;instId&#39;</span>
    <span class="n">channel</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instId</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="IndexTickers">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.IndexTickers">[docs]</a>
<span class="k">class</span> <span class="nc">IndexTickers</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">instId</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">idxPx</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">high24h</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">low24h</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">open24h</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">sodUtc0</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">sodUtc8</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">ts</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="IndexTickersChannel">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.IndexTickersChannel">[docs]</a>
<span class="k">class</span> <span class="nc">IndexTickersChannel</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">arg</span><span class="p">:</span> <span class="n">IndexTickersChannelInputArgs</span>
    <span class="n">data</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">IndexTickers</span><span class="p">]</span></div>



<div class="viewcode-block" id="IndexCandleSticksChannelInputArgs">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.IndexCandleSticksChannelInputArgs">[docs]</a>
<span class="k">class</span> <span class="nc">IndexCandleSticksChannelInputArgs</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">_primary_key_field</span> <span class="o">=</span> <span class="s1">&#39;instId&#39;</span>
    <span class="n">channel</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instId</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="IndexCandleSticksChannel">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.IndexCandleSticksChannel">[docs]</a>
<span class="k">class</span> <span class="nc">IndexCandleSticksChannel</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">arg</span><span class="p">:</span> <span class="n">IndexCandleSticksChannelInputArgs</span>
    <span class="n">data</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">CandleStick</span><span class="p">]</span>

<div class="viewcode-block" id="IndexCandleSticksChannel.from_array">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.IndexCandleSticksChannel.from_array">[docs]</a>
    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">from_array</span><span class="p">(</span><span class="n">arg</span><span class="p">:</span> <span class="n">IndexCandleSticksChannelInputArgs</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
        <span class="n">data</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">CandleStick</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span>
            <span class="n">CandleStick</span><span class="p">(</span>
                <span class="n">timestamp</span><span class="o">=</span><span class="n">item</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span>
                <span class="nb">open</span><span class="o">=</span><span class="n">item</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span>
                <span class="n">high</span><span class="o">=</span><span class="n">item</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span>
                <span class="n">low</span><span class="o">=</span><span class="n">item</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span>
                <span class="n">close</span><span class="o">=</span><span class="n">item</span><span class="p">[</span><span class="mi">4</span><span class="p">],</span>
                <span class="n">is_closed</span><span class="o">=</span><span class="n">item</span><span class="p">[</span><span class="mi">5</span><span class="p">]</span>
            <span class="p">)</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">data</span>
        <span class="p">]</span>
        <span class="k">return</span> <span class="n">IndexCandleSticksChannel</span><span class="p">(</span><span class="n">arg</span><span class="o">=</span><span class="n">arg</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="n">data</span><span class="p">)</span></div>
</div>



<div class="viewcode-block" id="AccountChannelInputArgs">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.AccountChannelInputArgs">[docs]</a>
<span class="k">class</span> <span class="nc">AccountChannelInputArgs</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">channel</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">ccy</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span>
    <span class="n">extraParams</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span></div>



<div class="viewcode-block" id="AccountChannelReturnArgs">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.AccountChannelReturnArgs">[docs]</a>
<span class="k">class</span> <span class="nc">AccountChannelReturnArgs</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">channel</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">uid</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="AccountChannel">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.AccountChannel">[docs]</a>
<span class="k">class</span> <span class="nc">AccountChannel</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">arg</span><span class="p">:</span> <span class="n">AccountChannelReturnArgs</span>
    <span class="n">data</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">AccountBalanceData</span><span class="p">]</span></div>



<div class="viewcode-block" id="WSPosition">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.WSPosition">[docs]</a>
<span class="k">class</span> <span class="nc">WSPosition</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">instType</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">mgnMode</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">posId</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">posSide</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">pos</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">baseBal</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">quoteBal</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">baseBorrowed</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">baseInterest</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">quoteBorrowed</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">quoteInterest</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">posCcy</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">availPos</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">avgPx</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">upl</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">uplRatio</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">uplLastPx</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">uplRatioLastPx</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instId</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">lever</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">liqPx</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">markPx</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">imr</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">margin</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">mgnRatio</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">mmr</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">liab</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">liabCcy</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">interest</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">tradeId</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">notionalUsd</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">optVal</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">adl</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">bizRefId</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">bizRefType</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">ccy</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">last</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">idxPx</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">usdPx</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">bePx</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">deltaBS</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">deltaPA</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">gammaBS</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">gammaPA</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">thetaBS</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">thetaPA</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">vegaBS</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">vegaPA</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">spotInUseAmt</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">spotInUseCcy</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">realizedPnl</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">pnl</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">fee</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">fundingFee</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">liqPenalty</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">closeOrderAlgo</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">dict</span><span class="p">]</span>
    <span class="n">cTime</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">uTime</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">pTime</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="PositionsChannelInputArgs">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.PositionsChannelInputArgs">[docs]</a>
<span class="k">class</span> <span class="nc">PositionsChannelInputArgs</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="c1"># {</span>
    <span class="c1">#       &quot;channel&quot;: &quot;positions&quot;,</span>
    <span class="c1">#       &quot;instType&quot;: &quot;ANY&quot;,</span>
    <span class="c1">#       &quot;extraParams&quot;: &quot;</span>
    <span class="c1">#         {</span>
    <span class="c1">#           \&quot;updateInterval\&quot;: \&quot;0\&quot;</span>
    <span class="c1">#         }</span>
    <span class="c1">#       &quot;</span>
    <span class="c1">#     }</span>
    <span class="n">channel</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instType</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instFamily</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span>
    <span class="n">instId</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span>
    <span class="n">extraParams</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span></div>



<div class="viewcode-block" id="PositionsChannelReturnArgs">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.PositionsChannelReturnArgs">[docs]</a>
<span class="k">class</span> <span class="nc">PositionsChannelReturnArgs</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">channel</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">uid</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instType</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instFamily</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span>
    <span class="n">instId</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span></div>



<div class="viewcode-block" id="PositionsChannel">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.PositionsChannel">[docs]</a>
<span class="k">class</span> <span class="nc">PositionsChannel</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">arg</span><span class="p">:</span> <span class="n">PositionsChannelReturnArgs</span>
    <span class="n">data</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">WSPosition</span><span class="p">]</span></div>



<div class="viewcode-block" id="BalanceAndPositionsChannelInputArgs">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.BalanceAndPositionsChannelInputArgs">[docs]</a>
<span class="k">class</span> <span class="nc">BalanceAndPositionsChannelInputArgs</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">channel</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="BalanceAndPositionsChannelReturnArgs">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.BalanceAndPositionsChannelReturnArgs">[docs]</a>
<span class="k">class</span> <span class="nc">BalanceAndPositionsChannelReturnArgs</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">channel</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">uid</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="ws_balData_element">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.ws_balData_element">[docs]</a>
<span class="k">class</span> <span class="nc">ws_balData_element</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">_primary_key_field</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">&quot;ccy&quot;</span>

    <span class="n">ccy</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">cashBal</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">uTime</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="ws_posData_element">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.ws_posData_element">[docs]</a>
<span class="k">class</span> <span class="nc">ws_posData_element</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">_primary_key_field</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">&quot;posId&quot;</span>

    <span class="n">posId</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">tradeId</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instId</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instType</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">mgnMode</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">posSide</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">pos</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">ccy</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">posCcy</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">avgPx</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">uTime</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="ws_trades_element">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.ws_trades_element">[docs]</a>
<span class="k">class</span> <span class="nc">ws_trades_element</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">_primary_key_field</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">&quot;tradeId&quot;</span>

    <span class="n">instId</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">tradeId</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="BalanceAndPositionData">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.BalanceAndPositionData">[docs]</a>
<span class="k">class</span> <span class="nc">BalanceAndPositionData</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">pTime</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">eventType</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">balData</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">ws_balData_element</span><span class="p">]</span>
    <span class="n">posData</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">ws_posData_element</span><span class="p">]</span>
    <span class="n">trades</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">ws_trades_element</span><span class="p">]</span></div>



<div class="viewcode-block" id="BalanceAndPositionsChannel">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.BalanceAndPositionsChannel">[docs]</a>
<span class="k">class</span> <span class="nc">BalanceAndPositionsChannel</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">arg</span><span class="p">:</span> <span class="n">BalanceAndPositionsChannelReturnArgs</span>
    <span class="n">data</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">BalanceAndPositionData</span><span class="p">]</span></div>



<div class="viewcode-block" id="WebSocketConnectionConfig">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.WebSocketConnectionConfig">[docs]</a>
<span class="k">class</span> <span class="nc">WebSocketConnectionConfig</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">_primary_key_field</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">&#39;name&#39;</span>
    <span class="n">name</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">channels</span><span class="p">:</span> <span class="nb">dict</span> <span class="o">=</span> <span class="p">{}</span>
    <span class="n">wss_url</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="OrdersChannelInputArgs">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.OrdersChannelInputArgs">[docs]</a>
<span class="k">class</span> <span class="nc">OrdersChannelInputArgs</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">channel</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instType</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instFamily</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span>
    <span class="n">instId</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span></div>



<div class="viewcode-block" id="OrdersChannelReturnArgs">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.OrdersChannelReturnArgs">[docs]</a>
<span class="k">class</span> <span class="nc">OrdersChannelReturnArgs</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">channel</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instType</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">uid</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instFamily</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span>
    <span class="n">instId</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span></div>



<div class="viewcode-block" id="WSOrder">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.WSOrder">[docs]</a>
<span class="k">class</span> <span class="nc">WSOrder</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">accFillSz</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">algoClOrdId</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">algoId</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">amendResult</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">amendSource</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">attachAlgoClOrdId</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">attachAlgoOrds</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span>
    <span class="n">avgPx</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">cTime</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">cancelSource</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">category</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">ccy</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">clOrdId</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">code</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">execType</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">fee</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">feeCcy</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">fillFee</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">fillFeeCcy</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">fillFwdPx</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">fillMarkPx</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">fillMarkVol</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">fillNotionalUsd</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">fillPnl</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">fillPx</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">fillPxUsd</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">fillPxVol</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">fillSz</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">fillTime</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instId</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instType</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">lastPx</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">lever</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">msg</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">notionalUsd</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">ordId</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">ordType</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">pnl</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">posSide</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">px</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">pxType</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">pxUsd</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">pxVol</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">quickMgnType</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">rebate</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">rebateCcy</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">reduceOnly</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">reqId</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">side</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">slOrdPx</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">slTriggerPx</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">slTriggerPxType</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">source</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">state</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">stpId</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">stpMode</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">sz</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">tag</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">tdMode</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">tgtCcy</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">tpOrdPx</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">tpTriggerPx</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">tpTriggerPxType</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">tradeId</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">uTime</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="OrdersChannel">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.OrdersChannel">[docs]</a>
<span class="k">class</span> <span class="nc">OrdersChannel</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">arg</span><span class="p">:</span> <span class="n">OrdersChannelReturnArgs</span>
    <span class="n">data</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">WSOrder</span><span class="p">]</span></div>



<div class="viewcode-block" id="OrderBookInputArgs">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.OrderBookInputArgs">[docs]</a>
<span class="k">class</span> <span class="nc">OrderBookInputArgs</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">channel</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instId</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="OrderBookReturnArgs">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.OrderBookReturnArgs">[docs]</a>
<span class="k">class</span> <span class="nc">OrderBookReturnArgs</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">channel</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">instId</span><span class="p">:</span> <span class="nb">str</span></div>



<div class="viewcode-block" id="OrderBookData">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.OrderBookData">[docs]</a>
<span class="k">class</span> <span class="nc">OrderBookData</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">asks</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">Ask</span><span class="p">]</span>
    <span class="n">bids</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">Bid</span><span class="p">]</span>
    <span class="n">ts</span><span class="p">:</span> <span class="nb">str</span>
    <span class="n">seqId</span><span class="p">:</span> <span class="nb">int</span>
    <span class="n">instId</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span>
    <span class="n">checksum</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">int</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span>
    <span class="n">prevSeqId</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">int</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span></div>



<div class="viewcode-block" id="OrderBookChannel">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.OrderBookChannel">[docs]</a>
<span class="k">class</span> <span class="nc">OrderBookChannel</span><span class="p">(</span><span class="n">OKXBaseModel</span><span class="p">):</span>
    <span class="n">arg</span><span class="p">:</span> <span class="n">OrderBookReturnArgs</span>
    <span class="n">data</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">OrderBookData</span><span class="p">]</span>
    <span class="n">action</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span>

<div class="viewcode-block" id="OrderBookChannel.from_array">
<a class="viewcode-back" href="../../pyokx.ws_data_structures.html#pyokx.ws_data_structures.OrderBookChannel.from_array">[docs]</a>
    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">from_array</span><span class="p">(</span><span class="n">arg</span><span class="p">:</span> <span class="n">OrderBookReturnArgs</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">action</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="kc">None</span><span class="p">):</span>
        <span class="n">arg</span> <span class="o">=</span> <span class="n">OrderBookReturnArgs</span><span class="p">(</span><span class="n">channel</span><span class="o">=</span><span class="n">arg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;channel&#39;</span><span class="p">),</span> <span class="n">instId</span><span class="o">=</span><span class="n">arg</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;instId&#39;</span><span class="p">))</span>

        <span class="n">data</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">OrderBookData</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span>
            <span class="n">OrderBookData</span><span class="p">(</span>
                <span class="n">asks</span><span class="o">=</span><span class="p">[</span><span class="n">Ask</span><span class="p">(</span><span class="n">price</span><span class="o">=</span><span class="n">ask</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">quantity</span><span class="o">=</span><span class="n">ask</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">deprecated_value</span><span class="o">=</span><span class="n">ask</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="n">number_of_orders</span><span class="o">=</span><span class="n">ask</span><span class="p">[</span><span class="mi">3</span><span class="p">])</span> <span class="k">for</span> <span class="n">ask</span> <span class="ow">in</span>
                      <span class="n">item</span><span class="p">[</span><span class="s1">&#39;asks&#39;</span><span class="p">]],</span>
                <span class="n">bids</span><span class="o">=</span><span class="p">[</span><span class="n">Bid</span><span class="p">(</span><span class="n">price</span><span class="o">=</span><span class="n">bid</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">quantity</span><span class="o">=</span><span class="n">bid</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">deprecated_value</span><span class="o">=</span><span class="n">bid</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="n">number_of_orders</span><span class="o">=</span><span class="n">bid</span><span class="p">[</span><span class="mi">3</span><span class="p">])</span> <span class="k">for</span> <span class="n">bid</span> <span class="ow">in</span>
                      <span class="n">item</span><span class="p">[</span><span class="s1">&#39;bids&#39;</span><span class="p">]],</span>
                <span class="n">ts</span><span class="o">=</span><span class="n">item</span><span class="p">[</span><span class="s1">&#39;ts&#39;</span><span class="p">],</span>
                <span class="n">seqId</span><span class="o">=</span><span class="n">item</span><span class="p">[</span><span class="s1">&#39;seqId&#39;</span><span class="p">],</span>
                <span class="n">instId</span><span class="o">=</span><span class="n">item</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;instId&#39;</span><span class="p">),</span>
                <span class="n">checksum</span><span class="o">=</span><span class="n">item</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;checksum&#39;</span><span class="p">),</span>
                <span class="n">prevSeqId</span><span class="o">=</span><span class="n">item</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;prevSeqId&#39;</span><span class="p">)</span>
            <span class="p">)</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">data</span>
        <span class="p">]</span>

        <span class="k">return</span> <span class="n">OrderBookChannel</span><span class="p">(</span><span class="n">arg</span><span class="o">=</span><span class="n">arg</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="n">data</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="n">action</span><span class="p">)</span></div>
</div>



<span class="n">OKX_WEBSOCKET_URLS</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">(</span>
    <span class="n">public</span><span class="o">=</span><span class="s2">&quot;wss://ws.okx.com:8443/ws/v5/public&quot;</span><span class="p">,</span>
    <span class="n">private</span><span class="o">=</span><span class="s2">&quot;wss://ws.okx.com:8443/ws/v5/private&quot;</span><span class="p">,</span>
    <span class="n">business</span><span class="o">=</span><span class="s2">&quot;wss://ws.okx.com:8443/ws/v5/business&quot;</span><span class="p">,</span>
    <span class="n">public_aws</span><span class="o">=</span><span class="s2">&quot;wss://wsaws.okx.com:8443/ws/v5/public&quot;</span><span class="p">,</span>
    <span class="n">private_aws</span><span class="o">=</span><span class="s2">&quot;wss://wsaws.okx.com:8443/ws/v5/private&quot;</span><span class="p">,</span>
    <span class="n">business_aws</span><span class="o">=</span><span class="s2">&quot;wss://wsaws.okx.com:8443/ws/v5/business&quot;</span><span class="p">,</span>
    <span class="n">public_demo</span><span class="o">=</span><span class="s2">&quot;wss://wspap.okx.com:8443/ws/v5/public?brokerId=9999&quot;</span><span class="p">,</span>
    <span class="n">private_demo</span><span class="o">=</span><span class="s2">&quot;wss://wspap.okx.com:8443/ws/v5/private?brokerId=9999&quot;</span><span class="p">,</span>
    <span class="n">business_demo</span><span class="o">=</span><span class="s2">&quot;wss://wspap.okx.com:8443/ws/v5/business?brokerId=9999&quot;</span><span class="p">,</span>
<span class="p">)</span>

<span class="n">public_channels_available</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s2">&quot;price-limit&quot;</span><span class="p">:</span> <span class="n">PriceLimitChannel</span><span class="p">,</span>
    <span class="s2">&quot;instruments&quot;</span><span class="p">:</span> <span class="n">InstrumentsChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price&quot;</span><span class="p">:</span> <span class="n">MarkPriceChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-tickers&quot;</span><span class="p">:</span> <span class="n">IndexTickersChannel</span><span class="p">,</span>
    <span class="s2">&quot;tickers&quot;</span><span class="p">:</span> <span class="n">TickersChannel</span><span class="p">,</span>
    <span class="s2">&quot;books5&quot;</span><span class="p">:</span> <span class="n">OrderBookChannel</span><span class="p">,</span>
    <span class="s2">&quot;books&quot;</span><span class="p">:</span> <span class="n">OrderBookChannel</span><span class="p">,</span>
    <span class="s2">&quot;bbo-tbt&quot;</span><span class="p">:</span> <span class="n">OrderBookChannel</span><span class="p">,</span>
    <span class="s2">&quot;books50-l2-tbt&quot;</span><span class="p">:</span> <span class="n">OrderBookChannel</span><span class="p">,</span>
    <span class="s2">&quot;books-l2-tbt&quot;</span><span class="p">:</span> <span class="n">OrderBookChannel</span><span class="p">,</span>
<span class="p">}</span>
<span class="n">business_channels_available</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s2">&quot;mark-price-candle1m&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle3m&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle5m&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle15m&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle30m&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle1H&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle2H&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle4H&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle6H&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle12H&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle5D&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle3D&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle2D&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle1D&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle1W&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle1M&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle3M&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle1Yutc&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle3Mutc&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle1Mutc&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle1Wutc&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle1Dutc&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle2Dutc&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle3Dutc&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle5Dutc&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle12Hutc&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;mark-price-candle6Hutc&quot;</span><span class="p">:</span> <span class="n">MarkPriceCandleSticksChannel</span><span class="p">,</span>
    <span class="c1">#</span>
    <span class="s2">&quot;index-candle1m&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle3m&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle5m&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle15m&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle30m&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle1H&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle2H&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle4H&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle6H&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle12H&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle5D&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle3D&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle2D&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle1D&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle1W&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle1M&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle3M&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle1Yutc&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle3Mutc&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle1Mutc&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle1Wutc&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle1Dutc&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle2Dutc&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle3Dutc&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle5Dutc&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle12Hutc&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
    <span class="s2">&quot;index-candle6Hutc&quot;</span><span class="p">:</span> <span class="n">IndexCandleSticksChannel</span><span class="p">,</span>
<span class="p">}</span>
<span class="n">private_channels_available</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s2">&quot;account&quot;</span><span class="p">:</span> <span class="n">AccountChannel</span><span class="p">,</span>  <span class="c1"># Missing coinUsdPrice</span>
    <span class="s2">&quot;positions&quot;</span><span class="p">:</span> <span class="n">PositionsChannel</span><span class="p">,</span>  <span class="c1"># Missing pTime</span>
    <span class="s2">&quot;balance_and_position&quot;</span><span class="p">:</span> <span class="n">BalanceAndPositionsChannel</span><span class="p">,</span>
    <span class="s2">&quot;orders&quot;</span><span class="p">:</span> <span class="n">OrdersChannel</span>
<span class="p">}</span>

<span class="n">available_channel_models</span> <span class="o">=</span> <span class="p">(</span>
        <span class="n">public_channels_available</span> <span class="o">|</span> <span class="n">business_channels_available</span> <span class="o">|</span> <span class="n">private_channels_available</span>
<span class="p">)</span>
</pre></div>

           </div>
          </div>
          <footer>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2024, Ruben Fernandez Carbon.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>